package com.ks.core.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 封装的错误异常类
 *
 * @author kingdee
 * @Date 2019/12/05 下午10:32
 */

@Data
@EqualsAndHashCode(callSuper = false)
public class BizException {
    private Integer err_code;

    private String err_message;

    public BizException(ServiceExceptionEnum serviceExceptionEnum) {
        this.err_code = serviceExceptionEnum.getCode();
        this.err_message = serviceExceptionEnum.getMessage();
    }

    public BizException(String message) {
        this.err_code = 500;
        this.err_message = message;
    }
}
